package cate.common.table.activity.goldegg.sheet;

import cate.common.table.ESheet;
import cate.common.table.activity.goldegg.row.GoldEggDrawRewardRow;

import java.util.List;
import java.util.OptionalInt;
import java.util.stream.Collectors;

public class GoldEggDrawRewardSheet extends ESheet<GoldEggDrawRewardRow> {
    @Override
    public String getSheetName() {
        return "次数奖励";
    }

    public List<GoldEggDrawRewardRow> findRowsByGroup(int group) {
        return getList().stream().filter(row->row.group==group).collect(Collectors.toList());
    }

    public int findMaxTimes(int group) {
        return getList().stream().filter(row -> row.group == group).mapToInt(row -> row.times).max().orElse(0);
    }
}
